package com.hys.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
@ApiModel("合作方式")
public class CooperMethodParam {

    @ApiModelProperty("是否有捐赠")
    private Boolean isDonation;

    @ApiModelProperty("本学年捐赠学校设备值")
    private Double donValue;

    @ApiModelProperty("本学年准捐赠学校设备值")
    private Double donPredictValue;

    @ApiModelProperty("捐赠明细")
    @Length(max = 50000, message = "捐赠明细最长不能超过50000个字符")
    private String donDetail;

    @ApiModelProperty("是否设立奖学金")
    private Boolean isScholarship;

    @ApiModelProperty("奖学金-总额")
    private Double schShipCount;

    @ApiModelProperty("奖学金-金额")
    private Double schShipFigure;

    @ApiModelProperty("设立的奖学金名称")
    @Length(max = 20, message = "设立的奖学金名称最长不能超过20个字符")
    private String schShipName;

    @ApiModelProperty("是否接受毕业生")
    private Boolean isAcceptGraduate;

    @ApiModelProperty("合计-人")
    private Integer accGraduateSum;

    @ApiModelProperty("接收近三届毕业生(除当年)总数")
    private Integer accGraduateRecent;

    @ApiModelProperty("接收应届毕业生人数人总数")
    private Integer accGraduateCurrent;

    @ApiModelProperty("接收学校专业课教师()人")
    private Integer accGraduateTeacher;

    @ApiModelProperty("挂职教师明细")
    @Length(max = 50000, message = "挂职教师明细最长不能超过50000个字符")
    private String accGraduateTeaDetail;

    @ApiModelProperty("接受实习生人")
    private Integer accGraduatePrNum;

    @ApiModelProperty("支付学生实习（）平均值")
    private Integer accGraduatePrReward;

    @ApiModelProperty("是否提供保险")
    private Boolean accGraduateInsurance;

    @ApiModelProperty("是否提供住宿")
    private Boolean accGraduateStay;

    /**
     * 设置默认值
     */
    public void setIsDefault() {
        if(isDonation == null ){
           isDonation = true;
        }
        if(isScholarship == null){
           isScholarship = true;
        }
        if(isAcceptGraduate == null){
            isAcceptGraduate = true;
        }
    }
    public void delWhenBooleanIsFalse() {

        if(isDonation == false){
            this.donValue = null;
            this.donPredictValue = null;
            this.donDetail = null;
        }

        if(isScholarship == false){
            this.schShipCount = null;
            this.schShipFigure = null;
            this.schShipName = null;
        }
        if(isAcceptGraduate == false){
            this.accGraduateSum = null;
            this.accGraduateRecent = null;
            this.accGraduateCurrent = null;
            this.accGraduateTeacher = null;
            this.accGraduateTeaDetail = null;
            this.accGraduatePrNum = null;
            this.accGraduatePrReward = null;
            this.accGraduateInsurance = null;
            this.accGraduateStay = null;
        }
    }
}
